/*
 * @Author: LVGRAPE
 * @LastEditors: LVGRAPE
 */
#ifndef __MOTOR_H
#define __MOTOR_H

#include "at32f421.h"

void motor_gpio_init(void);
void motor_tmr_init(void);
void motor1_set_duty(int16_t duty);
void motor2_set_duty(int16_t duty);

float motor1_pid_control(int32_t setCycle, float setAngle, float setSpeed,  float speedInput, float dtMs);
void m1_speed_pid_init(float kp, float ki, float kd);

#endif /* __MOTOR_H */
